package com.nl.lib_project.view.dialog

import android.app.Activity
import android.view.View
import androidx.core.content.ContextCompat
import com.github.gzuliyujiang.dialog.CornerRound
import com.github.gzuliyujiang.dialog.ModalDialog
import com.nl.lib_core.tool.extends.dp2px
import com.nl.lib_core.tool.extends.getColorResources
import com.nl.lib_core.tool.extends.gone
import com.nl.lib_project.R

/** 作者: wangfei 创建时间: 2021/12/30 包名: com.nl.lib_project.view.dialog 类名: PromptBaseNoHeadDialog */
open class PromptBaseNoHeadDialog(activity: Activity) : ModalDialog(activity) {

  init {
    getHeaderView().gone()
    setBackgroundColor(CornerRound.All, 16, context.getColorResources(R.color.color_white))
    setWidth(activity.dp2px(320f))
    setHeight(activity.dp2px(200f))
  }

  override fun initView() {
    super.initView()
    okView.setTextColor(ContextCompat.getColor(context, R.color.color_white))
    cancelView.setTextColor(ContextCompat.getColor(context, R.color.transparent100_gray))
  }

  override fun createBodyView(): View {
    return View.inflate(activity, R.layout.dialog_header_exit, null)
  }

  override fun createFooterView(): View? {
    return View.inflate(activity, R.layout.dialog_footer_style_4, null)
  }

  override fun onCancel() {}

  override fun onOk() {
    activity.finish()
  }
}
